package cn.edu.xmist.factory;

public class FactoryTest {
    public static void main(String[] args) {
        DefaultFactory defaultFactory = new DefaultFactory();
        AbstractProduct product = defaultFactory.createProduct();
        product.shareMehtod();
        product.doSomething();

        SecondFactory secondFactory = new SecondFactory();
        AbstractProduct product1 = secondFactory.createProduct();
        product1.shareMehtod();
        product1.doSomething();

        /**
         * 非抽象工厂模式
         */
        AbstractProduct product2 = new ProductB();
        product2.shareMehtod();
        product2.doSomething();

    }
}
